﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="OrderManager.aspx.cs" Inherits="OrderManager" Title="Đặt hàng" %>

<%@ Register Assembly="CollectionPager" Namespace="SiteUtils" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
    <div id="toolbar_box">
        <div class="t">
            <div class="t">
                <div class="t"></div>
            </div>
        </div>
        
        <div class="m">
            <div id="toolbar" class="toolbar">
                <table class="toolbar">
                    <tr>
                        <td id="toolbar_delete" class="button">
                            <%--<a href="#" class="toolbar">
                                <span class="icon-32-delete"></span>
                            Xóa</a>--%>
                            <asp:LinkButton runat="server" ID="lbtDelete" onclick="lbtDelete_Click" OnClientClick="return confirm('Bạn có chắc muốn xóa?');">
                                <span class="icon-32-delete"></span>
                                Xóa
                            </asp:LinkButton>
                        </td>
                        <%--<td id="toolbar_update" class="button"><a href="#" class="toolbar"><span class="icon-32-edit"></span>Sửa</a></td>--%>
                        <%--<td id="toolbar_add" class="button"><a href="AddUpdateProduct.aspx" class="toolbar"><span class="icon-32-new"></span>Thêm</a></td>--%>
                        <td id="toolbar_help" class="button"><a href="#" class="toolbar"><span class="icon-32-help"></span>Trợ giúp</a></td>
                    </tr>
                </table>
            </div>
            <div class="header order">
                Quản lý đơn hàng
            </div>
            <div class="clr"></div>
        </div>
        
        <div class="b">
            <div class="b">
                <div class="b"></div>
            </div>
        </div>
    </div><!--End toolbar_box--------------------------------------------------->
    
    
    <div id="element-box">
        <div class="t">
            <div class="t">
                <div class="t"></div>
            </div>
        </div>
        
        <div class="m">            
                <%--<table style="margin-bottom:5px;">
                    <tr>
                        <td style="width:200px; text-align:center;"><i style="color:Gray">Tìm kiếm sản phấm</i></td>
                        <td><strong>Tên sản phấm</strong></td>
                        <td>
                            <asp:TextBox runat="server" ID="txtProductName" Width="200"></asp:TextBox>
                        </td>
                        <td>
                            <asp:DropDownList runat="server" ID="ddlCategoryName" Width="200">
                                <asp:ListItem Text="Danh mục sản phẩm" Value="0"></asp:ListItem>
                            </asp:DropDownList>
                        </td>                                    
                        <td>
                            <asp:Button runat="server" ID="btReset" Text="Bỏ lọc" Width="100" 
                                onclick="btReset_Click"/>
                            <asp:Button runat="server" ID="btSearch" Text="Tìm kiếm" Width="100"
                                onclick="btSearch_Click"/>
                        </td>
                    </tr>
                </table>--%>
                
                <table class="adminlist">
                            <thead>
                                <tr>
                                    <th class="title" width="5%">STT</th>
                                    <th class="title" width="5%">
                                        <asp:CheckBox runat="server" ID="cbxCheckALLOrder" oncheckedchanged="cbxCheckALLOrder_CheckedChanged" AutoPostBack="true"/>
                                    </th>
                                    <th class="title" width="30%">Tên khách hàng</th>
                                    <th class="title" width="15%">Điện thoại</th>
                                    <th class="title" width="10%">Ngày tạo</th>   
                                    <th class="title" width="10%">Thanh toán</th>                                                                                                        
                                    <th class="title" width="10%">Trạng thái xử lý</th>                                    
                                </tr>
                            </thead>
                            <tbody>
                                
                                <asp:Repeater runat="server" ID="OrderRepeater">
                                    <ItemTemplate>
                                        <tr class="row0">
                                            <td align="center"><%#Container.ItemIndex + 1%></td>
                                            <td align="center">
                                                <asp:CheckBox runat="server" ID="cbxCheckOrder"/>
                                                <asp:TextBox runat="server" ID="txtOrderId" Text='<%# DataBinder.Eval(Container.DataItem, "ID")%>' Visible="false"></asp:TextBox>
                                            </td>                                            
                                            <td>
                                                <a href='OrderDetail.aspx?id=<%#DataBinder.Eval(Container.DataItem, "ID")%>'>
                                                    <%#DataBinder.Eval(Container.DataItem, "CUSTOMER_NAME")%>
                                                </a>
                                            </td>
                                            <td style="font-weight:bold;"><%#DataBinder.Eval(Container.DataItem, "MOBILE")%></td>                                            
                                            <td><%# String.Format("{0:d/M/yyyy HH:mm:ss tt}", DataBinder.Eval(Container.DataItem, "CREATE_DATE")) %></td>                                                                                        
                                            <td><%# get_Type_CheckOut(int.Parse(DataBinder.Eval(Container.DataItem, "TYPE_CHECKOUT").ToString()))%></td>
                                            <td align="center">                                                
                                                <asp:Image runat="server" ID="imgViewIsPublic" ImageUrl="~/App_Themes/Images/menu/icon-16-checkin.png" Visible='<%#(bool)DataBinder.Eval(Container.DataItem, "RECORD_STATUS")%>'/>
                                                <asp:Image runat="server" ID="imgViewIsBlock" ImageUrl="~/App_Themes/Images/menu/icon-16-block-status.png" Visible='<%#!(bool)DataBinder.Eval(Container.DataItem, "RECORD_STATUS")%>'/>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                    <AlternatingItemTemplate>
                                        <tr class="row1">
                                            <td align="center"><%#Container.ItemIndex + 1%></td>
                                            <td align="center">
                                                <asp:CheckBox runat="server" ID="cbxCheckOrder"/>
                                                <asp:TextBox runat="server" ID="txtOrderId" Text='<%# DataBinder.Eval(Container.DataItem, "ID")%>' Visible="false"></asp:TextBox>
                                            </td>                                            
                                            <td>
                                                <a href='OrderDetail.aspx?id=<%#DataBinder.Eval(Container.DataItem, "ID")%>'>
                                                    <%#DataBinder.Eval(Container.DataItem, "CUSTOMER_NAME")%>
                                                </a>
                                            </td>
                                            <td style="font-weight:bold;"><%#DataBinder.Eval(Container.DataItem, "MOBILE")%></td>                                            
                                            <td><%# String.Format("{0:d/M/yyyy HH:mm:ss tt}", DataBinder.Eval(Container.DataItem, "CREATE_DATE")) %></td>                                                                                        
                                            <td><%# get_Type_CheckOut(int.Parse(DataBinder.Eval(Container.DataItem, "TYPE_CHECKOUT").ToString()))%></td>
                                            <td align="center">                                                
                                                <asp:Image runat="server" ID="imgViewIsPublic" ImageUrl="~/App_Themes/Images/menu/icon-16-checkin.png" Visible='<%#(bool)DataBinder.Eval(Container.DataItem, "RECORD_STATUS")%>'/>
                                                <asp:Image runat="server" ID="imgViewIsBlock" ImageUrl="~/App_Themes/Images/menu/icon-16-block-status.png" Visible='<%#!(bool)DataBinder.Eval(Container.DataItem, "RECORD_STATUS")%>'/>
                                            </td>
                                        </tr>
                                    </AlternatingItemTemplate>                                    
                                </asp:Repeater>
                            </tbody>
                        </table>                                                                                        
            
            <div id="paging">
                <cc1:CollectionPager ID="cpPaging" runat="server" SliderSize="5" ResultsLocation="none" PageNumbersDisplay="Numbers" 
                    FirstText="Đầu" LastText="Cuối" ShowFirstLast="true" BackNextDisplay="HyperLinks" 
                    BackNextLocation="Split" PageNumbersSeparator="" LabelText="" ShowLabel="false" BackText="Trước" NextText="Sau">
                </cc1:CollectionPager>
            </div>
            
        </div>
        
        <div class="b">
            <div class="b">
                <div class="b"></div>
            </div>
        </div>
    </div><!--End element-box--------------------------------------------------->
    
</asp:Content>

